<template>
  <div class="dynamic-input">
    <input type="text" class="input-box" />
    <a href="#" class="input-icon">
      <img src="@/assets/images/searchImg.png" style="width: 30px" />
    </a>
  </div>
</template>
<script setup>
  const inputImg = '';
</script>
<style lang="scss" scoped>
  .dynamic-input {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2f3640;
    height: 40px;
    border-radius: 40px;
    padding: 10px;
  }
  .dynamic-input:hover .input-box {
    width: 200px;
    padding: 0 6px;
  }
  .dynamic-input:hover .input-icon {
    background-color: wheat;
  }
  .input-box {
    border: none;
    background: none;
    /* 取消选中搜索框时的外边框 */
    outline: none;
    width: 0;
    padding: 0;
    transition: 0.4s;
    line-height: 40px;
    font-size: 20px;
    color: wheat;
  }
  .input-icon {
    color: #e94118;
    float: right;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2f3640;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.4s;
  }
</style>
